package com.zxs.common.enums;

import lombok.Getter;

/**
 * 题目类型的枚举
 * 1单选  2多选  3判断  4简答
 * @author zxs
 * @date 2025/11/8 下午1:30
 */
@Getter
public enum SubjectInfoTypeEnum {
    RADIO(1, "单选"),
    MULTIPLE(2, "多选"),
    JUDGE(3, "判断"),
    BRIEF(4, "简答");

    private int code;
    private String msg;

    SubjectInfoTypeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static SubjectInfoTypeEnum getResultCodeEnum(int code) {
        for (SubjectInfoTypeEnum resultCodeEnum : SubjectInfoTypeEnum.values()) {
            if (resultCodeEnum.getCode() == code) {
                return resultCodeEnum;
            }
        }
        return null;
    }

}